package com.qi.spzx.manager.mapper;

import com.qi.spzx.model.dto.product.ProductDto;
import com.qi.spzx.model.entity.product.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Description TODO
 * @Author dingchunlin
 * @Date 2024/2/23 18:53
 * @Version 1.0.0
 */
@Mapper
public interface ProductMapper {


    List<Product> findByPage(ProductDto productDto);

    void save(Product product);

    @Select("select * from product where id = #{id} and is_deleted = 1")
    Product selectById(Long id);

    void updateById(Product product);

    @Update("update product set is_deleted = 0 , update_time = now() where id = #{id}")
    void deleteById(Long id);
}
